package l1j.opqlo.Timer.Controler;

import l1j.opqlo.NewSystem.地圖限時.MapTimeTable;
import l1j.opqlo.NewSystem.地圖限時.MapTimer;
import l1j.opqlo.Timer.血量魔量恢復.血量恢復王族;
import l1j.opqlo.Timer.血量魔量恢復.血量恢復黑暗妖精;
import l1j.opqlo.Timer.血量魔量恢復.血量恢復龍騎士;
import l1j.opqlo.Timer.血量魔量恢復.血量恢復妖精;
import l1j.opqlo.Timer.血量魔量恢復.血量恢復幻術士;
import l1j.opqlo.Timer.血量魔量恢復.血量恢復騎士;
import l1j.opqlo.Timer.血量魔量恢復.血量恢復法師;
import l1j.opqlo.Timer.血量魔量恢復.魔量恢復王族;
import l1j.opqlo.Timer.血量魔量恢復.魔量恢復黑暗妖精;
import l1j.opqlo.Timer.血量魔量恢復.魔量恢復龍騎士;
import l1j.opqlo.Timer.血量魔量恢復.魔量恢復妖精;
import l1j.opqlo.Timer.血量魔量恢復.魔量恢復幻術士;
import l1j.opqlo.Timer.血量魔量恢復.魔量恢復騎士;
import l1j.opqlo.Timer.血量魔量恢復.魔量恢復法師;
import l1j.opqlo.自動發放.推文發放;
import l1j.server.Config;

public class PcTimerControler {

	public void Load() throws InterruptedException {

		// 人物資料自動保存計時器
		if (Config.AUTOSAVE_INTERVAL > 0) {
			final PcAutoSaveTimer save = new PcAutoSaveTimer();
			save.start();
			Thread.sleep(50);// 延遲
		}
		// 背包物品自動保存計時器
		if (Config.AUTOSAVE_INTERVAL_INVENTORY > 0) {
			final PcAutoSaveInventoryTimer save = new PcAutoSaveInventoryTimer();
			save.start();
			Thread.sleep(50);// 延遲
		}
		// opqlo 特殊地圖計時系統相關
		final MapTimer maptime = new MapTimer();
		maptime.start();
		Thread.sleep(50);// 延遲
		MapTimeTable.getInstance().Load();
		// opqlo 特殊地圖計時系統相關
		Thread.sleep(50);// 延遲

		final 血量恢復王族 hprCrown = new 血量恢復王族();
		hprCrown.start();
		Thread.sleep(50);// 延遲

		final 血量恢復黑暗妖精 hprDarkElf = new 血量恢復黑暗妖精();
		hprDarkElf.start();
		Thread.sleep(50);// 延遲

		final 血量恢復龍騎士 hprDK = new 血量恢復龍騎士();
		hprDK.start();
		Thread.sleep(50);// 延遲

		final 血量恢復妖精 hprElf = new 血量恢復妖精();
		hprElf.start();
		Thread.sleep(50);// 延遲

		final 血量恢復幻術士 hprIllusionist = new 血量恢復幻術士();
		hprIllusionist.start();
		Thread.sleep(50);// 延遲

		final 血量恢復騎士 hprKnight = new 血量恢復騎士();
		hprKnight.start();
		Thread.sleep(50);// 延遲

		final 血量恢復法師 hprWizard = new 血量恢復法師();
		hprWizard.start();
		Thread.sleep(50);// 延遲

		final 魔量恢復王族 mprCrown = new 魔量恢復王族();
		mprCrown.start();
		Thread.sleep(50);// 延遲

		final 魔量恢復黑暗妖精 mprDarkElf = new 魔量恢復黑暗妖精();
		mprDarkElf.start();
		Thread.sleep(50);// 延遲

		final 魔量恢復龍騎士 mprDragonKnight = new 魔量恢復龍騎士();
		mprDragonKnight.start();
		Thread.sleep(50);// 延遲

		final 魔量恢復妖精 mprElf = new 魔量恢復妖精();
		mprElf.start();
		Thread.sleep(50);// 延遲

		final 魔量恢復幻術士 mprIllusionist = new 魔量恢復幻術士();
		mprIllusionist.start();
		Thread.sleep(50);// 延遲

		final 魔量恢復騎士 mprKnight = new 魔量恢復騎士();
		mprKnight.start();
		Thread.sleep(50);// 延遲

		final 魔量恢復法師 mprWizard = new 魔量恢復法師();
		mprWizard.start();
		Thread.sleep(50);// 延遲

		final PcDeleteTimer deletetime = new PcDeleteTimer();
		deletetime.start();
		Thread.sleep(50);// 延遲

		// PC EXP更新處理 時間軸
		if(!Config.USE_L1J){
			// PC 可見物更新處理 時間軸 XXX
			final UpdateObjectCTimer objectCTimer = new UpdateObjectCTimer();
			objectCTimer.start();
			Thread.sleep(50);// 延遲

			final UpdateObjectDKTimer objectDKTimer = new UpdateObjectDKTimer();
			objectDKTimer.start();
			Thread.sleep(50);// 延遲

			final UpdateObjectDTimer objectDTimer = new UpdateObjectDTimer();
			objectDTimer.start();
			Thread.sleep(50);// 延遲

			final UpdateObjectETimer objectETimer = new UpdateObjectETimer();
			objectETimer.start();
			Thread.sleep(50);// 延遲

			final UpdateObjectITimer objectITimer = new UpdateObjectITimer();
			objectITimer.start();
			Thread.sleep(50);// 延遲

			final UpdateObjectKTimer objectKTimer = new UpdateObjectKTimer();
			objectKTimer.start();
			Thread.sleep(50);// 延遲

			final UpdateObjectWTimer objectWTimer = new UpdateObjectWTimer();
			objectWTimer.start();
			Thread.sleep(50);// 延遲

//			// PC Lawful更新處理 時間軸
//			final LawfulTimer lawfulTimer = new LawfulTimer();
//			lawfulTimer.start();
			
			final ExpTimer expTimer = new ExpTimer();
			expTimer.start();
			Thread.sleep(50);// 延遲
//			
//			// PC 鬼魂模式處理 時間軸
//			final PcGhostTimer ghostTimer = new PcGhostTimer();
//			ghostTimer.start();
//			Thread.sleep(50);// 延遲
			
//			// 隊伍更新時間軸
//			final PartyTimer partyTimer = new PartyTimer();
//			partyTimer.start();
//			Thread.sleep(50);// 延遲
		}

		// 武器、防具 魔法時間軸
		final EnchantTimer enchant = new EnchantTimer();
		enchant.start();
		Thread.sleep(50);// 延遲

		final 推文發放 推文 = new 推文發放();
		推文.start();
		Thread.sleep(50);// 延遲

		final 雜務計時器 雜務 = new 雜務計時器();
		雜務.start();
		Thread.sleep(50);// 延遲

//		final ItemTimeDelete itemdelete = new ItemTimeDelete();
//		itemdelete.start();
//		Thread.sleep(50);

		final PcHellTimer hellTimer = new PcHellTimer();
		hellTimer.start();
	}
}
